home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 13.6 KB | 415 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: SLSemInt.cpp
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #define FW_OSemanticInterface_Class_Source
- #include "SLSemInt.xih"
-
- #ifndef FWSOMENV_H
- #include "FWSOMEnv.h"
- #endif
-
- //========================================================================================
- // Runtime Informations
- //========================================================================================
-
- #ifdef FW_BUILD_MAC
- #pragma segment fwsemevt
- #endif
-
- //========================================================================================
- // class FW_OSemanticInterface
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_OSemanticInterface::InitODFSemanticInterface
- //----------------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK FW_OSemanticInterface__InitODFSemanticInterface(FW_OSemanticInterface *somSelf,
- Environment *ev,
- ODPart* base,
- ODSession* session,
- FW_CSemanticInterface* semInt,
- FW_HSemIntGlueProcs semIntGlue)
- {
- FW_OSemanticInterfaceData *somThis = FW_OSemanticInterfaceGetData(somSelf);
- FW_OSemanticInterfaceMethodDebug("FW_OSemanticInterface","FW_OSemanticInterface__InitODFSemanticInterface");
-
- somThis->fGlueProcs = semIntGlue;
- somThis->fSemanticInterface = semInt;
-
- somSelf->InitSemanticInterface(ev, base, session);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_OSemanticInterface::somUninit
- //----------------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK FW_OSemanticInterface__somUninit(FW_OSemanticInterface *somSelf)
- {
- FW_OSemanticInterfaceData *somThis = FW_OSemanticInterfaceGetData(somSelf);
- FW_OSemanticInterfaceMethodDebug("FW_OSemanticInterface","FW_OSemanticInterface__somUninit");
-
- FW_TRY
- {
- FW_SOMEnvironment ev;
- somSelf->UsingPredispatchProc(ev, FALSE);
- }
- FW_CATCH_BEGIN
- FW_CATCH_EVERYTHING()
- {
- }
- FW_CATCH_END
-
- // FW_OSemanticInterface_parent_ODSemanticInterface_somUninit(somSelf);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_OSemanticInterface::Release
- //----------------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK FW_OSemanticInterface__Release(FW_OSemanticInterface *somSelf,
- Environment *ev)
- {
- FW_OSemanticInterfaceData *somThis = FW_OSemanticInterfaceGetData(somSelf);
- FW_OSemanticInterfaceMethodDebug("FW_OSemanticInterface","FW_OSemanticInterface__Release");
-
- FW_Boolean isValid = somSelf->IsValid(ev);
-
- FW_OSemanticInterface_parent_ODSemanticInterface_Release(somSelf,ev);
-
- if (!isValid && somSelf->GetRefCount(ev) == 0)
- delete somSelf;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_OSemanticInterface::CallEventHandler
- //----------------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK FW_OSemanticInterface__CallEventHandler(FW_OSemanticInterface *somSelf,
- Environment *ev,
- ODPart* thePart,
- ODAppleEvent* theODAppleEvent,
- ODAppleEvent* reply)
- {
- FW_UNUSED(thePart);
- FW_OSemanticInterfaceData *somThis = FW_OSemanticInterfaceGetData(somSelf);
- FW_OSemanticInterfaceMethodDebug("FW_OSemanticInterface","FW_OSemanticInterface__CallEventHandler");
-
- FW_PlatformError error;
-
- if (somSelf->IsValid(ev))
- {
- error = CallUniversalProc(somThis->fGlueProcs->_fCallEventHandlerGlue,
- FW_uppCallEventHandlerProcInfo, ev, somThis->fSemanticInterface,
- theODAppleEvent, reply);
- }
- else
- error = kODErrInvalidExtension;
-
- if (error != FW_xNoError)
- FW_SetEvError(ev, error);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_OSemanticInterface::CallCoercionHandler
- //----------------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK FW_OSemanticInterface__CallCoercionHandler(FW_OSemanticInterface *somSelf,
- Environment *ev,
- ODPart* thePart,
- ODDesc* theODDesc,
- ODDescType toType,
- ODDesc* theResult)
- {
- FW_UNUSED(thePart);
- FW_OSemanticInterfaceData *somThis = FW_OSemanticInterfaceGetData(somSelf);
- FW_OSemanticInterfaceMethodDebug("FW_OSemanticInterface","FW_OSemanticInterface__CallCoercionHandler");
-
- FW_PlatformError error;
-
- if (somSelf->IsValid(ev))
- {
- error = CallUniversalProc(somThis->fGlueProcs->_fCallCoercionHandlerGlue,
- FW_uppCallCoercionHandlerProcInfo, ev, somThis->fSemanticInterface,
- theODDesc, toType, theResult);
- }
- else
- error = kODErrInvalidExtension;
-
- if (error != FW_xNoError)
- FW_SetEvError(ev, error);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_OSemanticInterface::CallPredispatchProc
- //----------------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK FW_OSemanticInterface__CallPredispatchProc(FW_OSemanticInterface *somSelf,
- Environment *ev,
- ODPart* thePart,
- ODAppleEvent* theODAppleEvent,
- ODAppleEvent* reply)
- {
- FW_UNUSED(thePart);
- FW_OSemanticInterfaceData *somThis = FW_OSemanticInterfaceGetData(somSelf);
- FW_OSemanticInterfaceMethodDebug("FW_OSemanticInterface","FW_OSemanticInterface__CallPredispatchProc");
-
- FW_PlatformError error;
-
- if (somSelf->IsValid(ev))
- {
- error = CallUniversalProc(somThis->fGlueProcs->_fCallPredispatchProcGlue,
- FW_uppCallPredispatchProcInfo, ev, somThis->fSemanticInterface,
- theODAppleEvent, reply);
- }
- else
- error = kODErrInvalidExtension;
-
- if (error != FW_xNoError)
- FW_SetEvError(ev, error);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_OSemanticInterface::CallObjectAccessor
- //----------------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK FW_OSemanticInterface__CallObjectAccessor(FW_OSemanticInterface *somSelf,
- Environment *ev,
- ODPart* thePart,
- ODDescType desiredClass,
- ODOSLToken* container,
- ODDescType containerClass,
- ODDescType form,
- ODDesc* selectionData,
- ODOSLToken* value)
- {
- FW_UNUSED(thePart);
- FW_OSemanticInterfaceData *somThis = FW_OSemanticInterfaceGetData(somSelf);
- FW_OSemanticInterfaceMethodDebug("FW_OSemanticInterface","FW_OSemanticInterface__CallObjectAccessor");
-
- FW_PlatformError error;
-
- if (somSelf->IsValid(ev))
- {
- error = CallUniversalProc(somThis->fGlueProcs->_fCallObjectAccessorGlue,
- FW_uppCallObjectAccessorProcInfo, ev, somThis->fSemanticInterface,
- desiredClass, container, containerClass, form, selectionData, value);
- }
- else
- error = kODErrInvalidExtension;
-
- if (error != FW_xNoError)
- FW_SetEvError(ev, error);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_OSemanticInterface::CallCompareProc
- //----------------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK FW_OSemanticInterface__CallCompareProc(FW_OSemanticInterface *somSelf,
- Environment *ev,
- ODPart* thePart,
- ODDescType oper,
- ODOSLToken* obj1,
- ODOSLToken* obj2,
- ODBoolean* result)
- {
- FW_UNUSED(thePart);
- FW_OSemanticInterfaceData *somThis = FW_OSemanticInterfaceGetData(somSelf);
- FW_OSemanticInterfaceMethodDebug("FW_OSemanticInterface","FW_OSemanticInterface__CallCompareProc");
-
- FW_PlatformError error;
-
- if (somSelf->IsValid(ev))
- {
- error = CallUniversalProc(somThis->fGlueProcs->_fCallCompareProcGlue,
- FW_uppCallCompareProcInfo, ev, somThis->fSemanticInterface, oper, obj1, obj2, result);
- }
- else
- error = kODErrInvalidExtension;
-
- if (error != FW_xNoError)
- FW_SetEvError(ev, error);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_OSemanticInterface::CallCountProc
- //----------------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK FW_OSemanticInterface__CallCountProc(FW_OSemanticInterface *somSelf,
- Environment *ev,
- ODPart* thePart,
- ODDescType desiredType,
- ODDescType containerClass,
- ODOSLToken* container,
- ODSLong* result)
- {
- FW_UNUSED(thePart);
- FW_OSemanticInterfaceData *somThis = FW_OSemanticInterfaceGetData(somSelf);
- FW_OSemanticInterfaceMethodDebug("FW_OSemanticInterface","FW_OSemanticInterface__CallCountProc");
-
- FW_PlatformError error;
-
- if (somSelf->IsValid(ev))
- {
- error = CallUniversalProc(somThis->fGlueProcs->_fCallCountProcGlue,
- FW_uppCallCountProcInfo, ev, somThis->fSemanticInterface, desiredType,
- containerClass, container, result);
- }
- else
- error = kODErrInvalidExtension;
-
- if (error != FW_xNoError)
- FW_SetEvError(ev, error);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_OSemanticInterface::CallDisposeTokenProc
- //----------------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK FW_OSemanticInterface__CallDisposeTokenProc(FW_OSemanticInterface *somSelf,
- Environment *ev,
- ODPart* thePart,
- ODOSLToken* unneededToken)
- {
- FW_UNUSED(thePart);
- FW_OSemanticInterfaceData *somThis = FW_OSemanticInterfaceGetData(somSelf);
- FW_OSemanticInterfaceMethodDebug("FW_OSemanticInterface","FW_OSemanticInterface__CallDisposeTokenProc");
-
- FW_PlatformError error;
-
- if (somSelf->IsValid(ev))
- {
- error = CallUniversalProc(somThis->fGlueProcs->_fCallDisposeTokenProcGlue,
- FW_uppCallDisposeTokenProc, ev, somThis->fSemanticInterface, unneededToken);
- }
- else
- error = kODErrInvalidExtension;
-
- if (error != FW_xNoError)
- FW_SetEvError(ev, error);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_OSemanticInterface::CallGetErrDescProc
- //----------------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK FW_OSemanticInterface__CallGetErrDescProc(FW_OSemanticInterface *somSelf,
- Environment *ev,
- ODPart* thePart,
- ODDesc** errDesc)
- {
- FW_UNUSED(thePart);
- FW_OSemanticInterfaceData *somThis = FW_OSemanticInterfaceGetData(somSelf);
- FW_OSemanticInterfaceMethodDebug("FW_OSemanticInterface","FW_OSemanticInterface__CallGetErrDescProc");
-
- FW_PlatformError error;
-
- if (somSelf->IsValid(ev))
- {
- error = CallUniversalProc(somThis->fGlueProcs->_fCallGetErrDescProcGlue,
- FW_uppCallGetErrDescProcInfo, ev, somThis->fSemanticInterface, errDesc);
- }
- else
- error = kODErrInvalidExtension;
-
- if (error != FW_xNoError)
- FW_SetEvError(ev, error);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_OSemanticInterface::CallGetMarkTokenProc
- //----------------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK FW_OSemanticInterface__CallGetMarkTokenProc(FW_OSemanticInterface *somSelf,
- Environment *ev,
- ODPart* thePart,
- ODOSLToken* dContainerToken,
- ODDescType containerClass,
- ODOSLToken* result)
- {
- FW_UNUSED(thePart);
- FW_OSemanticInterfaceData *somThis = FW_OSemanticInterfaceGetData(somSelf);
- FW_OSemanticInterfaceMethodDebug("FW_OSemanticInterface","FW_OSemanticInterface__CallGetMarkTokenProc");
-
- FW_PlatformError error;
-
- if (somSelf->IsValid(ev))
- {
- error = CallUniversalProc(somThis->fGlueProcs->_fCallGetMarkTokenProcGlue,
- FW_uppCallGetMarkTokenProcInfo, ev, somThis->fSemanticInterface, dContainerToken,
- containerClass, result);
- }
- else
- error = kODErrInvalidExtension;
-
- if (error != FW_xNoError)
- FW_SetEvError(ev, error);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_OSemanticInterface::CallMarkProc
- //----------------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK FW_OSemanticInterface__CallMarkProc(FW_OSemanticInterface *somSelf,
- Environment *ev,
- ODPart* thePart,
- ODOSLToken* dToken,
- ODOSLToken* markToken,
- ODSLong index)
- {
- FW_UNUSED(thePart);
- FW_OSemanticInterfaceData *somThis = FW_OSemanticInterfaceGetData(somSelf);
- FW_OSemanticInterfaceMethodDebug("FW_OSemanticInterface","FW_OSemanticInterface__CallMarkProc");
-
- FW_PlatformError error;
-
- if (somSelf->IsValid(ev))
- {
- error = CallUniversalProc(somThis->fGlueProcs->_fCallMarkProcGlue,
- FW_uppCallMarkProcInfo, ev, somThis->fSemanticInterface, dToken,
- markToken, index);
- }
- else
- error = kODErrInvalidExtension;
-
- if (error != FW_xNoError)
- FW_SetEvError(ev, error);
- }
-
- //----------------------------------------------------------------------------------------
- // FW_OSemanticInterface::CallAdjustMarksProc
- //----------------------------------------------------------------------------------------
-
- SOM_Scope void SOMLINK FW_OSemanticInterface__CallAdjustMarksProc(FW_OSemanticInterface *somSelf,
- Environment *ev,
- ODPart* thePart,
- ODSLong newStart,
- ODSLong newStop,
- ODOSLToken* markToken)
- {
- FW_UNUSED(thePart);
- FW_OSemanticInterfaceData *somThis = FW_OSemanticInterfaceGetData(somSelf);
- FW_OSemanticInterfaceMethodDebug("FW_OSemanticInterface","FW_OSemanticInterface__CallAdjustMarksProc");
-
- FW_PlatformError error;
-
- if (somSelf->IsValid(ev))
- {
- error = CallUniversalProc(somThis->fGlueProcs->_fCallAdjustMarksProcGlue,
- FW_uppCallAdjustMarksProcInfo, ev, somThis->fSemanticInterface, newStart,
- newStop, markToken);
- }
- else
- error = kODErrInvalidExtension;
-
- if (error != FW_xNoError)
- FW_SetEvError(ev, error);
- }
-